package org.jtzc.springaifunction.fun;


import java.util.Date;
import java.util.function.Function;


public class CurrentTimeFun implements Function<CurrentTimeFun.Request, CurrentTimeFun.Response> {

    public record Request(String location) {}
    public record Response(String time) {}
    @Override
    public Response apply(Request request) {
        System.out.println("==============");
        long currTime = System.currentTimeMillis();
        Date date = new Date(currTime);
        return new Response(date.toString());
    }
}
